#include <cstdio>
#include <iostream>
#include <algorithm>
#include <queue>
#include <string>
using namespace std;
#define IOS ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
typedef long long ll;
ll m, n, k, t, cnt = 1, ans;
string s1;
double c;
void solve()
{
    priority_queue<ll, vector<ll>, greater<ll>> q;
    while (getline(cin, s1) && s1 != "END")
    {
        ans = 0;
        sort(s1.begin(), s1.end());
        cnt = 1;
        m = s1.length();
        for (int i = 1; i < m; i++)
        {
            if (s1[i] != s1[i - 1])
            {
                q.push(cnt);
                cnt = 1;
            }
            else
                cnt++;
        }
        q.push(cnt);

        if (q.size() == 1)
            ans = s1.length();
        while (q.size() > 1)
        {
            ll a = q.top();
            q.pop();
            ll b = q.top();
            q.pop();
            q.push(a + b);
            ans += a + b;
        }
        q.pop();
        c = s1.length() * 8.0 / ans * 1.0;
        printf("%d %d ", s1.length() * 8, ans);
        printf("%.1lf\n", c);
    }
    return;
}
int main()
{
    int t = 1;
    //     IOS;
    //    cin>>t;
    while (t--)
    {
        solve();
    }
}
